class GrindselectsController < ApplicationController
  # GET /grindselects
  # GET /grindselects.xml
  def index
    @grindselects = Grindselect.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @grindselects }
    end
  end

  # GET /grindselects/1
  # GET /grindselects/1.xml
  def show
    @grindselect = Grindselect.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @grindselect }
    end
  end

  # GET /grindselects/new
  # GET /grindselects/new.xml
  def new
    @grindselect = Grindselect.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @grindselect }
    end
  end

  # GET /grindselects/1/edit
  def edit
    @grindselect = Grindselect.find(params[:id])
  end

  # POST /grindselects
  # POST /grindselects.xml
  def create
    @grindselect = Grindselect.new(params[:grindselect])

    respond_to do |format|
      if @grindselect.save
        flash[:notice] = 'Grindselect was successfully created.'
        format.html { redirect_to(@grindselect) }
        format.xml  { render :xml => @grindselect, :status => :created, :location => @grindselect }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @grindselect.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /grindselects/1
  # PUT /grindselects/1.xml
  def update
    @grindselect = Grindselect.find(params[:id])

    respond_to do |format|
      if @grindselect.update_attributes(params[:grindselect])
        flash[:notice] = 'Grindselect was successfully updated.'
        format.html { redirect_to(@grindselect) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @grindselect.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /grindselects/1
  # DELETE /grindselects/1.xml
  def destroy
    @grindselect = Grindselect.find(params[:id])
    @grindselect.destroy

    respond_to do |format|
      format.html { redirect_to(grindselects_url) }
      format.xml  { head :ok }
    end
  end
end
